<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/app/include/init_app.jsp" %>
<%
	String category_code 	= StringUtil.nvl(request.getParameter("category_code"));
	String book_name		= StringUtil.toHan(request.getParameter("book_name"));
	HashList bookList 		= (HashList)request.getAttribute("bookList");
%>
<!DOCTYPE html>
<html class="ui-mobile">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
	<title><%= HOME_NAME %></title>
	<link rel="stylesheet" href="../../css/mobile.app.css"/>
	<link rel="stylesheet" href="../../css/jquery.mobile-1.4.2.min.css"/>
	<script src="../../js/jquery-1.11.0.min.js"></script>
	
	
	<script type="text/javascript">
	
	
	</script>
	
</head>
<body>
    <div class="ui-page ui-page-theme-a ui-page-active">
    		
         <div>
        	<div id="book_search">
        		
	        	<form name="searchForm" method="get" action="./bookList.app">
	        		<div class="ui-input-search ui-body-inherit ui-corner-all ui-input-has-clear">
		        		<input type="text" name="book_name" value="<%= book_name %>" placeholder="큐북명, 발행자명, 저자명"/>
		        		<button type="submit"  value="검색">검색</button>
		        	</div>
        		</form>
        	</div>
        	<ul class="book_list">
<%		for (int i = 0; i < bookList.size(); i++) { %>
				<li>
					<a href="./bookDetail.app?book_code=<%= bookList.get("book_code",i)%>">
						<div class="image" style="background-size:cover; background:transparent url(<%= bookList.get("book_image_url",i) %>) no-repeat;"></div>
						<h3><%= bookList.get("book_name",i) %></h3>
						<p class="author"><%= bookList.get("author_name",i) %> 저, <%= bookList.get("publisher_name", i) %></p>
						<p>
							<%-- <span class="starRating">
								<span style="width:<%=bookList.get("rate",i)%>%"><%=bookList.get("rate",i)%>점</span>
							</span> --%>
							<span class="star"><%= CommonUtil.getReviewStar(bookList.getInt("rate",i)) %></span>
							<span class="reviewCount">
								<%= bookList.getPrice("review_count",i) %> reviews
							</span>
						</p>
				<%	if ("0".equals(bookList.get("book_type",i))) {	 %>
						<p><span >무료</span></p>
				<%	} else if ("1".equals(bookList.get("book_type",i))) { %>
						<p><span class="price"><%= bookList.getPrice("price",i) %></span>원</p>
				<%	} %>
					</a>
				</li>
<%		} %>
        	</ul>
        	
        </div>
  	</div>
</body>
</html>

